Skip to content

Migrate remaining V2 APIs from @EndPoint/@Command to JAX-RS#21

Draft
Copilot wants to merge 9 commits intomainfrom
copilot/migrate-v2-apis-to-jax-rs
Draft

Migrate remaining V2 APIs from @EndPoint/@Command to JAX-RS#21
Copilot wants to merge 9 commits intomainfrom
copilot/migrate-v2-apis-to-jax-rs

Conversation

Copy link

Copilot AI commented Feb 21, 2026

Several V2 API handlers still used Solr's older home-grown @EndPoint/@Command annotation-dispatch system instead of JAX-RS. This PR completes the migration so all V2 APIs follow the same JAX-RS pattern already used by GetPublicKeyApi, ContainerPluginsApi, etc.

Migrated APIs

Node APIs

  • NodeHealthAPINodeHealth + NodeHealthApi interface + NodeHealthResponse model
  • NodeThreadsAPINodeThreads + NodeThreadsApi interface
  • NodePropertiesAPINodeProperties
  • NodeSystemInfoAPINodeSystemInfo

Cluster APIs

  • ClusterAPICluster + ClusterApis interface; ClusterNodeRoles + ClusterNodeRolesApis interface
  • New models: AddRoleRequestBody, RateLimiterPayload

CoreAdmin APIs

  • RejoinLeaderElectionAPI, OverseerOperationAPI, SplitCoreAPI, RequestCoreRecoveryAPI, PrepareCoreRecoveryAPI, RequestApplyCoreUpdatesAPI, RequestSyncShardAPI, RequestBufferUpdatesAPI

Collections/Shards APIs

  • SplitShardAPI, MigrateDocsAPI, ModifyCollectionAPI, MoveReplicaAPI, RebalanceLeadersAPI

Pattern change

Old command-dispatch (body wraps params in a named-command key):

POST /api/collections/mycoll -d '{"modify": {"replicationFactor": 2}}'
POST /api/collections/mycoll -d '{"move-replica": {"shard": "shard1", "node": "node2"}}'

New JAX-RS (flat body to a dedicated path):

POST /api/collections/mycoll/modify -d '{"replicationFactor": 2}'
POST /api/collections/mycoll/move-replica -d '{"shard": "shard1", "node": "node2"}'

Cleanup

  • Deleted obsolete V2ClusterAPIMappingTest, V2NodeAPIMappingTest, V2CoreAPIMappingTest, V2CollectionAPIMappingTest, V2ShardsAPIMappingTest — these tested the old mapping infrastructure, not actual behaviour.
  • Added unit tests for all migrated APIs in solr/core/src/test/org/apache/solr/handler/admin/api/ verifying parameter mapping to handler params.
  • Fixed V2ApiIntegrationTest (testException, testIntrospect, testSingleWarning) which were using old command-style POST bodies that now 404.
  • Fixed TestApiFramework which asserted over collection-path @Command entries that no longer exist; replaced with a self-contained inner test class.
  • Updated reference guide docs (shard-management.adoc, replica-management.adoc, collection-management.adoc, collections-api.adoc, v2-api.adoc) to reflect new JAX-RS paths.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • develocity.apache.org
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -XX:ReservedCodeCacheSize=256m -XX:TieredStopAtLevel=1 -XX:+UseParallelGC -XX:ActiveProcessorCount=1 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 21, 2026 22:17
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and migrate V2 APIs to use JAX-RS Migrate ClusterAPI, NodeHealthAPI, and NodeThreadsAPI from @EndPoint to JAX-RS Feb 21, 2026
Copilot AI and others added 2 commits February 21, 2026 23:54
Migrated the following old-style V2 API classes to JAX-RS:

Task 1 - Delete dead old-style API files:
- Deleted NodeHealthAPI.java (replaced by NodeHealth.java JAX-RS impl)
- Deleted NodeThreadsAPI.java (replaced by NodeThreads.java JAX-RS impl)
- Deleted RenameCoreAPI.java (replaced by RenameCore.java JAX-RS impl)

Task 2 - Delete/update test files:
- Deleted V2NodeAPIMappingTest.java (all tested APIs migrated to JAX-RS)
- Deleted V2CoreAPIMappingTest.java (all tested APIs migrated to JAX-RS)
- Deleted V2CollectionAPIMappingTest.java (all tested APIs migrated to JAX-RS)
- Deleted V2ShardsAPIMappingTest.java (SplitShardAPI migrated to JAX-RS)

Task 3 - Migrate NodePropertiesAPI to JAX-RS:
- Created NodePropertiesApi.java endpoint interface
- Created NodePropertiesResponse.java model
- Created NodeProperties.java JAX-RS implementation
- Updated PropertiesRequestHandler to use getJerseyResources()
- Deleted NodePropertiesAPI.java

Task 4 - Migrate NodeSystemInfoAPI to JAX-RS:
- Created NodeSystemInfoApi.java endpoint interface
- Created NodeSystemInfo.java JAX-RS implementation
- Updated SystemInfoHandler to use getJerseyResources()
- Deleted NodeSystemInfoAPI.java

Task 5 - Migrate CoreAdmin @endpoint APIs to JAX-RS:
- Created OverseerOperationApi/OverseerOperation (POST /node/overseer-op)
- Created RejoinLeaderElectionApi/RejoinLeaderElection (POST /node/rejoin-leader-election)
- Created SplitCoreApi/SplitCore (POST /cores/{coreName}/split)
- Created RequestCoreRecoveryApi/RequestCoreRecovery (POST /cores/{coreName}/request-recovery)
- Created PrepareCoreRecoveryApi/PrepareCoreRecovery (POST /cores/{coreName}/prep-recovery)
- Created RequestApplyCoreUpdatesApi/RequestApplyCoreUpdates (POST /cores/{coreName}/request-apply-updates)
- Created RequestSyncShardApi/RequestSyncShard (POST /cores/{coreName}/request-sync-shard)
- Created RequestBufferUpdatesApi/RequestBufferUpdates (POST /cores/{coreName}/request-buffer-updates)
- Updated CoreAdminHandler to use getJerseyResources()
- Deleted all old CoreAdmin *API.java files

Task 6 - Migrate Collections @endpoint APIs to JAX-RS:
- Created SplitShardApi/SplitShard (POST /collections/{collectionName}/shards/split)
- Created MigrateDocsApi/MigrateDocs (POST /collections/{collectionName}/migrate)
- Created ModifyCollectionApi/ModifyCollection (POST /collections/{collectionName}/modify)
- Created MoveReplicaApi/MoveReplica (POST /collections/{collectionName}/move-replica)
- Created RebalanceLeadersApi/RebalanceLeaders (POST /collections/{collectionName}/rebalance-leaders)
- Updated CollectionsHandler to use getJerseyResources()
- Deleted all old Collections *API.java files

New model classes in solr/api/model:
- OverseerOperationRequestBody, RejoinLeaderElectionRequestBody
- SplitCoreRequestBody, PrepareCoreRecoveryRequestBody
- SplitShardRequestBody, MigrateDocsRequestBody
- ModifyCollectionRequestBody, MoveReplicaRequestBody
- RebalanceLeadersRequestBody, NodePropertiesResponse

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ict and test failures

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Copilot AI changed the title Migrate ClusterAPI, NodeHealthAPI, and NodeThreadsAPI from @EndPoint to JAX-RS Migrate remaining V2 @EndPoint/@Command APIs to JAX-RS Feb 22, 2026
Copilot AI requested a review from epugh February 22, 2026 00:06
Tests verify that v2 request body fields are correctly mapped to v1
params passed to handleRequestBody() for APIs migrated from the old
@EndPoint/@command style. Coverage added for:

- SplitShard, MigrateDocs, ModifyCollection, MoveReplica, RebalanceLeaders
  (collections APIs using CollectionsHandler)
- SplitCore, RequestCoreRecovery, PrepareCoreRecovery, RequestApplyCoreUpdates,
  RequestSyncShard, RequestBufferUpdates (CoreAdminAPIBase using MultiCoreHandler)
- OverseerOperation, RejoinLeaderElection (JerseyResource using MultiCoreHandler)
- NodeProperties (reads from NodeConfig directly)
- NodeSystemInfo (delegates to SystemInfoHandler)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title Migrate remaining V2 @EndPoint/@Command APIs to JAX-RS Migrate remaining V2 APIs from @EndPoint/@Command to JAX-RS Feb 22, 2026
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…ingleWarning for JAX-RS migration

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…d reference guide docs

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants